<?php

/**
 * 
 * @author Liqiang
 * @email 2074956@qq.com
 * @data  2016-2-6 19:30:56
 */
class PictureViewModel extends ViewModel {

    function _initialize() {
        $this->viewFields[] = array(
            '_table' => TABLE_ACTIVE_ACTIVE_IMAGES,
            '_field' => array(
                'id',
                'active_name_id',
                'client_log_id',
                'img',
                'zan',
                'time',
                'u_time',
                'status'
            ),
            '_alias' => 'a'
        );
        $this->viewFields[] = array(
            '_table' => TABLE_ACTIVE_ACTIVE_NAME,
            '_field' => array(
                'title',
                'active_type_id'
            ),
            '_alias' => 'b',
            '_on' => '`a`.`active_name_id` = b.id',
            '_type' => 'left'
        );
//        $this->viewFields[] = array(
//            '_table' => TABLE_SOURCE_BASIC_FIELD,
//            '_field' => array(
//                'name' => 'active_type'
//            ),
//            '_alias' => 'c',
//            '_on' => '`b`.`active_type_id` = concat(`c`.`group_id`,`c`.`id`)',
//            '_type' => 'left'
//        );
        $this->viewFields[] = array(
            '_table' => TABLE_SOURCE_CLIENT_LOGIN,
            '_field' => array(
                'account',
                'nickname',
                'name'
            ),
            '_alias' => 'd',
            '_on' => '`d`.`id` =`a`.`client_log_id`',
            '_type' => 'left'
        );
//        $this->viewFields[] = array(
//            '_table' => TABLE_SOURCE_BASIC_FIELD,
//            '_field' => array(
//                'name' => 'sign_status'
//            ),
//            '_alias' => 'e',
//            '_on' => '`a`.`sign_status_id` = concat(`e`.`group_id`,`e`.`id`)',
//            '_type' => 'left'
//        );
        parent::_initialize();
    }

}
